/**
 * Created by python on 18-11-14.
 */

var aaa = new Vue({
    el:"#answer",
    data:{
        base,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        answer_list: [],
    },

    mounted:function () {
        // 一加载就需要做的，直接是代码
        axios.get(this.base + '/user/answers/' + this.user_id + '/', {
                // 向后端传递JWT token的方法
                headers: {
                    'Authorization': 'JWT ' + this.token
                },
                responseType: 'json',
        })
            .then(response =>{
                 console.log(response.data)
                this.answer_list = response.data
            })
            .catch(error =>{
                alert("数据返回错误")
            })
    },
    methods:{

    }
})